import request from '@/utils/request'

// 查询培训信息列表
export function listTraining(query) {
  return request({
    url: '/classai/training/list',
    method: 'get',
    params: query
  })
}

// 查询培训信息详细
export function getTraining(id) {
  return request({
    url: '/classai/training/getInfo/' + id,
    method: 'get'
  })
}

// 新增培训信息
export function addTraining(data) {
  return request({
    url: '/classai/training/add',
    method: 'post',
    data: data
  })
}

// 修改培训信息
export function updateTraining(data) {
  return request({
    url: '/classai/training/edit',
    method: 'post',
    data: data
  })
}

// 删除培训信息
export function delTraining(id) {
  return request({
    url: '/classai/training/remove/' + id,
    method: 'get'
  })
}
// 查询培训信息详细
export function getTrainingInfo(id) {
  return request({
    url: '/classai/training/getInfo/' + id,
    method: 'get'
  })
}
// 新增培训课程
export function addTrainingCourse(data) {
  return request({
    url: '/classai/trainingCourse/add',
    method: 'post',
    data: data
  })
}
// 修改培训课程
export function editTrainingCourse(data) {
  return request({
    url: '/classai/trainingCourse/edit',
    method: 'post',
    data: data
  })
}
// 查询培训课程列表
export function listTrainingCourse(query) {
  return request({
    url: '/classai/trainingCourse/list',
    method: 'get',
    params: query
  })
}
// 查询培训信息详细
export function getTrainingCourseInfo(id) {
  return request({
    url: '/classai/trainingCourse/getInfo/' + id,
    method: 'get'
  })
}
// 删除培训课程
export function delTrainingCourse(id) {
  return request({
    url: '/classai/trainingCourse/remove/' + id,
    method: 'get'
  })
}
// 查询培训课程列表
export function listTrainingTeacherList(query) {
  return request({
    url: '/classai/trainingCourse/getTrainingTeacherList',
    method: 'get',
    params: query
  })
}
// 新增培训学员
export function addTrainingTeacher(data) {
  return request({
    url: '/classai/trainingCourse/addTrainingTeacher',
    method: 'post',
    data: data
  })
}
// 学生信息导入
export function importStudent(data, trainingId) {
  return request({
    url: '/classai/trainingCourse/importStudent',
    method: 'post',
    data: {file: data, trainingId},
    headers: {
      "Content-Type": "multipart/form-data"
    },
  })
}
// 编辑培训学员
export function editTrainingTeacher(data) {
  return request({
    url: '/classai/trainingCourse/editTrainingTeacher',
    method: 'post',
    data: data
  })
}
// 删除培训课程
export function delTrainingTeacher(query) {
  return request({
    url: '/classai/trainingCourse/removeTrainingTeacher',
    method: 'get',
    params: query
  })
}
// 修改培训课程
export function deleteVideo(videoId) {
  return request({
    url: '/classai/trainingCourse/deleteVideo',
    method: 'get',
    params: {videoId}
  })
}
